home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 3 / Gold Medal Software - Volume 3 (Gold Medal) (1994).iso / prog / dnalib59.arj / PRINTER.BAS < prev    next >
BASIC Source File  |  1994-02-14  |  636b  |  16 lines

  1. FUNCTION Printer%(Port%)PUBLIC
  2.  
  3. LOCAL Status%
  4.  
  5. REG 1, &H0200                           ' set AH to 2
  6. REG 4, Port%                            ' set DX to the parallel port number
  7. CALL INTERRUPT &H17                     ' call BIOS interrupt 17h
  8. Status% = REG(1) \ 256                  ' Status% is a byte read from AH
  9.  
  10. IF (Status% AND &B00000001) THEN Printer% = 1  ' printer has timed out
  11. IF (Status% AND &B00001000) THEN Printer% = 2  ' printer has had an I/O error
  12. IF (Status% AND &B00100000) THEN Printer% = 3  ' printer is out of paper
  13. IF (Status% AND &B10000000) = 0 THEN Printer% = 4  ' printer is OK
  14.  
  15. END FUNCTION
  16.